*Replication Instructions for

*Anti-LGBT Messaging and Electoral Outcomes under the Shadow of War: Evidence from the 2023 Polish Parliamentary Election. 

*Phillip Ayoub, Douglas Page, Sam Whitt


*Below are instructions for replicating all manuscript and online appendix tables and figures in STATA using the dataset "EJPR Poland replication data". Please contact Sam Whitt (swhitt@highpoint.edu) for questions regarding data replication. See also the dofile "EJPR Poland replication do file". 

*Note: You may need to install STATA packages for the cibar, catcibar, and iebaltab commands. Use findit with the command name to identify and download the appropriate packets to install. 

*Note: In addition, some graphs require additional formatting using filename.grec files with the graph play command. To format a graph, simply run the command to generate the graph in the do file in STATA, then open the "Graph Editor" in STATA and click on the GREEN "Play Recording" button, then select "Browse" to select the grec file from the folder "grec files for STATA graph formatting" among Replication files. The name of the grec file is indicated in the note below the graph command in the do file for the specific graph you wish to format. This should automatically format the graph, which you may then save to a location of your choosing.

*Manuscript Replication

*"Stata user generated commands to install for replication purposes"

*"cibar"

ssc install cibar, replace

*"iebaltab from ietoolkit"

ssc install ietoolkit, replace

*"catcibar"

net install catcibar, from("https://aarondwolf.github.io/catcibar") replace

*"marginscontplot and marginscontplot2"

net install gr0056, from(http://www.stata-journal.com/software/sj13-3) replace
ssc install marginscontplot2, replace

*"interflex"

ssc install interflex

*Figure 2

histogram revvotepisduda , discrete percent addlabels addlabopts(mlabformat(%2.1f))
graph save g1
histogram revvotepotusk , discrete percent addlabels addlabopts(mlabformat(%2.1f))
graph save g2
histogram tuskbias3, discrete percent addlabels addlabopts(mlabformat(%2.1f))
graph save g3

graph combine "g1.gph" "g2.gph" "g3.gph"

*refer to "Figure 2 formatting.grec" file to format the resulting combined graph.

*Table 2

reg dvoteduda i.experiment2, robust
reg dvotetusk i.experiment2, robust
reg dtuskbias i.experiment2, robust

*in Model 2 we observe that linking anti-LGBTIQ rhetoric to the war in Ukraine resulted in a 13% increase in support for PO/Tusk (unpaired t-test=3.06, p<0.002) 

ttest dvotetusk if experiment2~=2 & experiment2~=3, by(ukrainetxt) unpaired unequal

*Figure 3

interflex dtuskbias ukrainetxt revcontactgay, type(kernel) bw(0.80) vce(robust)
graph save g4.gph
interflex dtuskbias ukrainetxt closegay, type(kernel) bw(2.5) vce(robust)
graph save g5.gph
interflex dtuskbias ukrainetxt supportrights, type(kernel) bw(1) vce(robust)
graph save g6.gph
interflex dtuskbias ukrainetxt putinfav, type(kernel) bw(2.8)  vce(robust)
graph save g7.gph
interflex dtuskbias ukrainetxt russiadefeat, type(kernel) bw(8.9) vce(robust)
graph save g8.gph
interflex dtuskbias ukrainetxt dudafav, type(kernel) bw(1)  vce(robust)
graph save g9.gph

graph combine "g4.gph" "g5.gph" "g6.gph" "g7.gph" "g8.gph" "g9.gph"

*use "Figure 3 formatting.grec" file to format the resulting combined graph.

*Appendix Replication

*Appendix Figure. Likelihood of Voting for PiS vs. PO

catcibar dvotetusk dvoteduda, over(experiment2)

*Appendix Figure. Favorable Views of Duda

catcibar dudafav, over(experiment2)

*Appendix Figure: LGBT+ Rights Support by Likelihood of Voting for PiS/Duda

cibar supportrights, over1(experiment2) over2(dvoteduda)

*Descriptive Statistics

sum livefree supportrights closegay russiadefeat dudafav putinfav revukrainefav revcontactgay revimpreligion revimpnationality age education

tab dvoteduda
tab dvotetusk
tab dtuskbias
tab female
tab region
tab urban
tab employment
tab experiment2
tab leftright3

*Randomization and Covariate Balance

iebaltab female age education region urban employment leftright revimpreligion revimpnationality livefree russiafav ukrainefav, groupvar(experiment2) control(1) savexlsx(polandbalance)

*Likelihood of Voting for PO/Tusk (OLS Regression)

reg dvotetusk ukrainetxt if experiment2~=2 & experiment2~=3, robust
reg dvotetusk ukrainetxt leftright if experiment2~=2 & experiment2~=3, robust
reg dvotetusk ukrainetxt##c.leftright if experiment2~=2 & experiment2~=3, robust

teffects psmatch (dvotetusk) (ukrainetxt leftright) if experiment2~=2 & experiment2~=3, vce(iid)

*Sensitivity Analysis

reg dvotetusk ukrainetxt leftright, robust

regsensitivity bounds dvotetusk ukrainetxt female age education i.region i.urban i.employment leftright revimpreligion revimpnationality revcontactgay livefree revrussiafav revukrainefav if experiment2~=2 & experiment2~=3, compare(leftright)

*Power calculations

 power oneway, n(1000) power(0.8 0.9 0.95 0.99) ngroups(4)
esize twosample dvotetusk if experiment2~=2 & experiment2~=3, by(ukrainetxt)

*Likelihood of Voting for PO/Tusk over PiS/Duda (OLS Regression)

reg dtuskbias i.experiment2 , robust
reg dtuskbias i.experiment2 ib3.leftright3 voteeu livefree revcontactgay closega dudafav putinfav revukrainefav russiadefeat revimpreligion revimpnationality   female age education i.region i.urban i.employment, robust

*Likelihood of Voting for PO/Tusk over PiS/Duda (Logistic Regression)

logit dtuskbias i.experiment2 , robust
logit dtuskbias i.experiment2 ib3.leftright3 voteeu livefree revcontactgay closega dudafav putinfav revukrainefav russiadefeat revimpreligion revimpnationality   female age education i.region i.urban i.employment, robust

*Accounting for Duda+Putin+Ukraine Treatment Effects (OLS Regression)

reg dtuskbias ukrainetxt , robust
reg dtuskbias ukrainetxt##ib3.leftright3 , robust
reg dtuskbias ukrainetxt##c.livefree, robust
reg dtuskbias ukrainetxt##c.dudafav, robust
reg dtuskbias ukrainetxt##c.putinfav, robust
reg dtuskbias ukrainetxt##c.revukrainefav, robust
reg dtuskbias ukrainetxt##c.revcontactgay, robust
reg dtuskbias ukrainetxt##c.closegay, robust
reg dtuskbias ukrainetxt##c.supportrights, robust
reg dtuskbias ukrainetxt##c.russiadefeat, robust

*Relationship between Left-Right Ideology and LGBT+ Attitudes (OLS Regression)

reg livefree leftright  female age education i.region i.urban i.employment  revimpreligion revimpnationality   revrussiafav revukrainefav , robust

*Likelihood of Party Votes by Treatment Groups and LGBTIQ Tolerance

logit dvotetusk i.experiment2##c.livefree, robust
logit dvoteduda i.experiment2##c.livefree, robust

*Figure – Treatment Effects Moderated by Pre-Txt LGBT+ Rights Support

reg dvotetusk i.experiment2##c.livefree, robust
mcp  livefree experiment2, at2(1 2 3 4)

*Relationship between Age and PiS/PO Voting

reg dvotetusk i.experiment2 c.age, robust
reg dvoteduda i.experiment2 c.age, robust

reg dvotetusk i.experiment2##c.age, robust
reg dvoteduda i.experiment2##c.age, robust

reg dvoteduda i.experiment2##c.age, robust
mcp age experiment2, at2(1 2 3 4)

reg dvoteduda i.experiment2##i.agecat, robust
margins i.experiment2, at(agecat=(3))
marginsplot 

*Mediation Analysis – Duda's Moral Authority and PO Support

cibar dudafav, over1(experiment2)

*Mediating Effects of declines in Duda's Moral Authority on Voting PiS (OLS regression)

reg dvotetusk ukrainetxt dudatxt, robust
reg dvotetusk ukrainetxt dudatxt dudafav, robust
reg dudafav ukrainetxt dudatxt, robust

sem (dudafav -> dvotetusk, ) (ukrainetxt -> dvotetusk, ) (ukrainetxt -> dudafav, ) (dudatxt -> dvotetusk, ) (dudatxt -> dudafav, ), nocapslatent vce(robust)
medsem, indep(ukrainetxt) med(dudafav) dep(dvotetusk) zlc rit rid

log close